/**
 * Created by think on 2016/9/15.
 */
angular.module('myApp', ['ui.bootstrap','ui.router'])

    .controller('SubscribitonCtrl',  [ '$http','$scope','$state', function ($http,$scope,$state) {


        $scope.items=new Array();
        $scope.url="/accounts/subscribtion";
        $scope.getItems=function () {
            $http.get($scope.url,{},config).then(function successCallback(response) {
                var status_code = response.data.status_code;
                switch (status_code) {
                    case 200:
                        $scope.items = resoponse.data.items;
                        break;
                    case 422:
                        $scope.errors = response.data.errors;
                        break;
                }
            }, function errorCallback(response) {
                console.log(JSON.stringify(response.data));
            });

        }


    }]);
